package study2018.com.xtianzhuang.www.designPattern.SingleTonPattern;

public class SingleTonDemo {
	private static SingleTonDemo instance = null;

	// 私有构造 防止创建对象
	private SingleTonDemo() {

	}
	
	public synchronized static SingleTonDemo getInstance() {
		System.out.println("123");
		return instance == null ? new SingleTonDemo() : instance;
	}
}
